<template>
  <div class="storePAI">
    <div class="storePAI__title">{{ title }}</div>
    <div class="storePAI__value--list">
      <div class="storePAI__value--item" v-for="value in data" :key="value.no">
        <div :class="{ rank: true, active: value.no <= 3 }">{{ value.no }}</div>
        <div class="name">{{ value.name }}</div>
        <div class="number">{{ value.count }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default {
  name: "storePAI",
};
</script>

<script lang="ts" setup>
import type { RankItem } from "../saleAndVisitedChart/index.vue";
const props = defineProps<{
  data: RankItem[];
  title: string;
}>();
</script>

<style scoped>
.storePAI {
  width: 100%;
  height: 100%;
}
.storePAI__title {
  font-size: 14px;
  margin-top: 40px;
  font-weight: 700;
}
.storePAI__value--list {
  margin-top: 15px;
}
.storePAI__value--item {
  position: relative;
  display: flex;
  font-size: 12px;
  height: 20px;
  align-items: center;
  margin: 6px 20px 6px 0;
  justify-content: space-between;
  left: 0;
}
.active {
  position: absolute;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background-color: black;
  color: #fff;
}
.rank {
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  position: absolute;
}
.name {
  margin-left: 30px;
  
}
</style>
